<template>
  <div class="box" ref="Progress"></div>
</template>

<script>
import * as echarts from "echarts";
export default {
  name: "ProgressCharts",
  mounted() {
    // 初始化eacharts
    let ProgressCharts = echarts.init(this.$refs.Progress);
    // 配置数据
    ProgressCharts.setOption({
      xAxis: {
        show: false,
        // 最大值与最小值
        min: 0,
        max: 100,
      },
      yAxis: {
        show: false,
        type: "category",
      },
      // 系列
      series: [
        {
          type: "bar",
          data: [87],
          barWidth: 10,
          color: "yellowgreen",
          // 背景颜色设置
          showBackground: true,
          backgroundStyle: {
            color: "red",
          },
        },
      ],
      // 布局
      grid: {
        letf: 0,
        top: 0,
        right: 20,
        bottom: 0,
      },
    });
  },
};
</script>

<style>
.box {
  width: 100%;
  height: 100%;
}
</style>